﻿//using Modding.Blocks;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using UnityEngine;
//using UnityEngine.SceneManagement;

//public class JoystickWindow : SafeUIBehaviour
//{
//    public override bool ShouldShowGUI { get; set; } = true;
//    public bool showGUI = true;

//    public StickType stickType = StickType.XBox;

//    public enum StickType
//    {
//        XBox = 0,
//        X56 = 1
//    }


//    public override void SafeAwake()
//    {
//        windowRect = new Rect(15f, 100f, 356f, 288f+100f + 75f);
//        windowName = "JoyStick Window  Ctrl+F10";
//    }

//    private void Update()
//    {     
//        if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.F10))
//        {
//            showGUI = !showGUI;
//        }
//        ShouldShowGUI = showGUI /*&& !StatMaster.levelSimulating*/ && IsBuilding() && !StatMaster.inMenu;
//    }




//    public float x = 10;
//    public float y = 15;
//    public float w = 100;
//    public float h = 25;

//    //public static int select = 0;
//    protected override void WindowContent(int windowID)
//    {    
//        GUILayout.BeginHorizontal();
//        {
//            GUI.BeginGroup(new Rect(8, 24, 100, 40));
//            GUI.Box(new Rect(0, 0, 100, 40), "LB");
//            GUI.Toggle(new Rect(42, 18, 10, 10), Input.GetKey(KeyCode.Joystick1Button4), /*"LB"*/"");
//            GUI.EndGroup();

//            GUI.HorizontalSlider(new Rect(118, 38, 120, 0), JoyAxis.getAxisValue((int)AxisIndex.MiddleAxis), 1f, -1f);

//            GUI.BeginGroup(new Rect(8 + 240, 24, 100, 40));
//            GUI.Box(new Rect(0, 0, 100, 40), "RB");
//            GUI.Toggle(new Rect(42, 18, 10, 10), Input.GetKey(KeyCode.Joystick1Button5), /*"LB"*/"");
//            GUI.EndGroup();
//        }
//        GUILayout.EndHorizontal();

//        GUILayout.BeginHorizontal();
//        {
//            GUILayout.BeginVertical();
//            {
//                GUI.BeginGroup(new Rect(8, 72, 100, 100));
//                GUI.Box(new Rect(0, 0, 100, 100), "JoyStick");
//                GUI.Button(new Rect((JoyAxis.getAxisValue(0) + 1) * 40, (JoyAxis.getAxisValue(1) + 1) * 40, 20, 20), "+");
//                GUI.EndGroup();

//                GUI.BeginGroup(new Rect(8, 180, 100, 100));
//                GUI.Box(new Rect(0, 0, 100, 100), "Pad");
//                GUI.Button(new Rect((JoyAxis.getAxisValue(5) + 1) * 40, (1 - JoyAxis.getAxisValue(6)) * 40, 20, 20), "+");
//                GUI.EndGroup();
//            }
//            GUILayout.EndVertical();

//            GUILayout.BeginVertical();
//            {
//                GUI.BeginGroup(new Rect(118, 32 + 100, 50, 40));
//                GUI.Box(new Rect(0, 0, 50, 40), "Back");
//                GUI.Toggle(new Rect(18, 18, 10, 10), Input.GetKey(KeyCode.Joystick1Button6), /*"LB"*/"");
//                GUI.EndGroup();

//                GUI.BeginGroup(new Rect(128 + 60, 32 + 100, 50, 40));
//                GUI.Box(new Rect(0, 0, 50, 40), "Start");
//                GUI.Toggle(new Rect(18, 18, 10, 10), Input.GetKey(KeyCode.Joystick1Button7), /*"LB"*/"");
//                GUI.EndGroup();

//                GUI.BeginGroup(new Rect(118, 180, 50, 40));
//                GUI.Box(new Rect(0, 0, 50, 40), "8");
//                GUI.Toggle(new Rect(18, 18, 10, 10), Input.GetKey(KeyCode.Joystick1Button8), /*"LB"*/"");
//                GUI.EndGroup();

//                GUI.BeginGroup(new Rect(128 + 60, 180, 50, 40));
//                GUI.Box(new Rect(0, 0, 50, 40), "9");
//                GUI.Toggle(new Rect(18, 18, 10, 10), Input.GetKey(KeyCode.Joystick1Button9), /*"LB"*/"");
//                GUI.EndGroup();
//            }
//            GUILayout.EndVertical();

//            GUILayout.BeginVertical();
//            {
//                GUI.BeginGroup(new Rect(248, 72, 100, 100));
//                GUI.Box(new Rect(0, 0, 100, 100), "Buttons");
//                GUI.Toggle(new Rect(42, 18, 10, 10), Input.GetKey(KeyCode.Joystick1Button3), /*"LB"*/"");
//                GUI.Toggle(new Rect(16, 46, 10, 10), Input.GetKey(KeyCode.Joystick1Button2), /*"LB"*/"");
//                GUI.Toggle(new Rect(16 + 54, 46, 10, 10), Input.GetKey(KeyCode.Joystick1Button1), /*"LB"*/"");
//                GUI.Toggle(new Rect(42, 74, 10, 10), Input.GetKey(KeyCode.Joystick1Button0), /*"LB"*/"");
//                GUI.EndGroup();

//                GUI.BeginGroup(new Rect(248, 180, 100, 100));
//                GUI.Box(new Rect(0, 0, 100, 100), "JoyStick");
//                GUI.Button(new Rect((JoyAxis.getAxisValue((int)AxisIndex.RightHorizontalAxis) + 1) * 40, (JoyAxis.getAxisValue((int)AxisIndex.RightVerticlAxis) + 1) * 40, 20, 20), "+");
//                GUI.EndGroup();
//            }
//            GUILayout.EndVertical();
//        }
//        GUILayout.EndHorizontal();

//        GUILayout.BeginHorizontal();
//        {
//            GUILayout.BeginArea(new Rect(10, 288, 336, 40), "Selet Joystick");
//            GUILayout.Space(18);
//            JoyAxis.JoyIndex = GUILayout.Toolbar(JoyAxis.JoyIndex, Input.GetJoystickNames());
//            GUILayout.EndArea();
          
//            GUILayout.BeginArea(new Rect(10, 316, 340, 120));
//            GUILayout.Space(18);
//            GUILayout.BeginVertical();

//            GUILayout.BeginHorizontal();
//            {
//                GUILayout.Label(string.Format("Axis 0 Value: {0}", JoyAxis.getAxisValue(0).ToString("0.00")));
//                GUILayout.Label(string.Format("Axis 1 Value: {0}", JoyAxis.getAxisValue(1).ToString("0.00")));
//                GUILayout.Label(string.Format("Axis 2 Value: {0}", JoyAxis.getAxisValue(2).ToString("0.00")));
//                GUILayout.Label(string.Format("Axis 3 Value: {0}", JoyAxis.getAxisValue(3).ToString("0.00")));
//            }
//            GUILayout.EndHorizontal();
//            GUILayout.Space(10);
//            GUILayout.BeginHorizontal();
//            {
//                GUILayout.Label(string.Format("Axis 4 Value: {0}", JoyAxis.getAxisValue(4).ToString("0.00")));
//                GUILayout.Label(string.Format("Axis 5 Value: {0}", JoyAxis.getAxisValue(5).ToString("0.00")));
//                GUILayout.Label(string.Format("Axis 6 Value: {0}", JoyAxis.getAxisValue(6).ToString("0.00")));
//                GUILayout.Label(string.Format("Axis 7 Value: {0}", JoyAxis.getAxisValue(7).ToString("0.00")));
//            }
//            GUILayout.EndHorizontal();

//            GUILayout.EndVertical();
//            GUILayout.EndArea();
//        }
//        GUILayout.EndHorizontal();

      

//        GUI.DragWindow();
//    }

  
//}
